/*
 * GLPrivateStore.h
 *
 *  Created on: Nov 3, 2014
 *      Author: yuliang
 */

#ifndef GLPRIVATESTORE_H_
#define GLPRIVATESTORE_H_

#include "LogicBase/GLContainerBase.h"

class CGLPrivateStore: public CGLContainerBase {
	friend std::string& operator<< (std::string& ss, uint64_t ti);
public:
	typedef VecGoods_t			VecStoreGoods_t;
public:
	CGLPrivateStore(UserId_t uid);
	virtual ~CGLPrivateStore();

	virtual bool DecodeContainerExtend(const std::string& info);
	virtual bool EncodeContainerExtend(std::string& info);
//	virtual bool DecodeGoodsExtend(uint8_t box, Index_t index, const std::string& info);
//	virtual bool EncodeGoodsExtend(CGLGoodsBase*, std::string& info);

	inline void AddGold(const Gold_t& gold) { m_Gold += gold; }
	inline void DelGold(const Gold_t& gold) { m_Gold -= gold; }
	inline void SetGold(const Gold_t& gold) { m_Gold = gold; }
	inline const Gold_t& GetGold() const { return m_Gold; }
protected:
	// 新建物品,并初始化
	virtual CGLGoodsBase* getGoods();
	virtual void setGoods(CGLGoodsBase* goods);
	virtual const GoodsFixInfo* getGoodsFixInfo(Type_t type) const;
private:
	Gold_t						m_Gold;
};

#endif /* GLPRIVATESTORE_H_ */
